//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package io.gitee.caoxiaoyu97.util;

import groovy.lang.GroovyClassLoader;
import org.codehaus.groovy.control.CompilationFailedException;
import org.codehaus.groovy.control.CompilerConfiguration;

public class GroovyUtil {
    private static final GroovyClassLoader groovyClassLoader;

    public GroovyUtil() {
    }

    public static Class parseClass(String text) throws CompilationFailedException {
        Class<?> pluginClass = groovyClassLoader.parseClass(text);
        return pluginClass;
    }

    public static GroovyClassLoader get() {
        return groovyClassLoader;
    }

    static {
        CompilerConfiguration config = new CompilerConfiguration();
        config.setSourceEncoding("UTF-8");
        groovyClassLoader = new GroovyClassLoader(Thread.currentThread().getContextClassLoader(), config);
    }
}
